{include file="inc/header_index_mui.html"}
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/aui.css" />
<script src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1.10.2_d88366fd.js"></script>


<div class="mui-content aui-mar-t-15">
<form action="{url x="index" r="user#dologin"}" id="com_login_box" class="mui-input-group aui-mar-t-15 ">
	<p id='login-form' class="mui-input-group aui-mar-t-15 ">
		<div class="mui-input-row">
			<label>账号</label>
			<input id='account' type="text" name="user_key" class="mui-input-clear mui-input" placeholder="请输入账号">
		</div>
		<div class="mui-input-row">
			<label>密码</label>
			<input id='password' type="password" name="user_pwd" class="mui-input-clear mui-input" placeholder="请输入密码">
		</div>
	</p>
	<p class="mui-input-group aui-mar-t-5">
		<ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell">
				自动登录
				<div id="autoLogin" class="mui-switch">
					<div class="mui-switch-handle"></div>
				</div>
			</li>
		</ul>
	</p>
	<div class="aui-mar-t-15 mui-text-center">
		<button type="button" class="aui-col-5 mui-btn mui-btn-blue" onclick="$('#com_login_box').submit();">登录</button>
		<div class="link-area aui-mar-t-15"><a id='reg' href="{url x="index" r="user#register"}">注册账号</a> <span class="spliter">|</span> <a id='forgetPassword' href="{url x="index" r="user#getpassword"}" >忘记密码</a>
	</div>
	<div class="mui-content-padded oauth-area">
</form>	
</div>


<script type="text/javascript">
	mui.init()
</script>
<script>
$("#com_login_box").bind("submit",function(){

	var user_key = $.trim($(this).find("input[name='user_key']").val());
	var user_pwd = $.trim($(this).find("input[name='user_pwd']").val());
	if(user_key=="")
	{
		alert("请输入登录帐号");
		return false;
	}
	if(user_pwd=="")
	{
		alert("请输入密码");
		return false;
	}

	var query = $(this).serialize();
	var ajax_url = $(this).attr("action");
	$.ajax({
		url:ajax_url,
		data:query,
		type:"POST",
		dataType:"json",
		success:function(obj){
			if(obj.status)
			{
				alert(obj.info);
				location.href = obj.jump;
			}
			else
			{
				alert(obj.info);
			}
		}
	});

	return false;
});
</script>
